package com.youkeda.dewu.dataobject;

import java.io.Serializable;
import java.util.Date;

import com.youkeda.dewu.model.ProductDetail;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * product_detail
 * @author 
 */
@Data
public class ProductDetailDO implements Serializable {
    private String id;

    /**
     * 关联商品
     */
    private String productId;

    /**
     * 价格
     */
    private Double price;

    /**
     * 尺码
     */
    private Double size;

    /**
     * 库存
     */
    private Integer stock;

    private Date gmtCreated;

    private Date gmtModified;

    private static final long serialVersionUID = 1L;

    public ProductDetailDO() {
    }
    public ProductDetailDO(ProductDetail productDetail) {
        BeanUtils.copyProperties(productDetail,this);
    }

    public ProductDetail toModel(){
        ProductDetail productDetail = new ProductDetail();
        BeanUtils.copyProperties(this,productDetail);
        return productDetail;
    }
}